export const getIfElChildOfParent = (el, parent) => {
    if (el && parent) {
        if (el === parent) {
            return true
        } else {
            return getIfElChildOfParent(el.parentElement, parent)
        }
    } else {
        return false
    }
}

export const evaluateIfElChildOf = (el, parentChecker, defaultValue) => {
    if (el) {
        const checkResult = parentChecker(el)
        if (checkResult) {
            return checkResult
        } else {
            return evaluateIfElChildOf(el.parentElement, parentChecker, defaultValue)
        }
    } else {
        return defaultValue
    }
}